home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / vg-2.03 / video / video.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-03  |  2.0 KB  |  99 lines

  1. /*
  2.  * Copyright (C) 1990-1992 Michael Davidson.
  3.  * All rights reserved.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software
  6.  * and its documentation for any purpose and without fee is hereby
  7.  * granted, provided that the above copyright notice appear in all
  8.  * copies and that both that copyright notice and this permission
  9.  * notice appear in supporting documentation.
  10.  *
  11.  * This software is provided "as is" without express or implied warranty.
  12.  */
  13.  
  14. #ifndef    VIDEO_H
  15. #define    VIDEO_H
  16.  
  17. /*
  18.  * video mode
  19.  */
  20. struct    __vmode
  21. {
  22.     int        width;
  23.     int        height;
  24.     int        depth;
  25.     int        flags;
  26. };
  27.  
  28. typedef struct __vmode    vmode_t;
  29.  
  30. #define    V_MODE_SUPPORTED    0x80
  31. #define    V_TEXT_MODE        0x01
  32. #define    V_GRAPHICS_MODE        0x02
  33.  
  34. /*
  35.  * color map
  36.  */
  37. typedef struct __color
  38. {
  39.     unsigned char    red;
  40.     unsigned char    green;
  41.     unsigned char    blue;
  42. } color_t;
  43.  
  44. typedef unsigned char    pixel8_t;
  45.  
  46. typedef struct
  47. {
  48.     unsigned char    r;
  49.     unsigned char    g;
  50.     unsigned char    b;
  51. } pixel24_t;
  52.  
  53. /*
  54.  * font structure
  55.  */
  56. typedef struct __font
  57. {
  58.     int            f_width;
  59.     int            f_height;
  60.     unsigned char    *f_data;
  61. } font_t;
  62.  
  63. void    vidInit(char *);
  64. void    vidReset();
  65. vmode_t    *vidGetModes();
  66. vmode_t    *vidModeInfo(int);
  67. int    vidGetMode();
  68. int    vidSetMode(int);
  69. char    *vidGetName();
  70. void    vidSetGamma(long, long, long);
  71. void    vidSetGraphicsRedraw(int (*)());
  72. int    vidPutPixels8(int x, int y, pixel8_t *pixels, int npixels);
  73. int    vidPutPixels24(int x, int y, pixel24_t *pixels, int npixels);
  74. int    vidCheckScreenSwitch(int);
  75. void    vidPutText(int    x, int    y, char    *buf, int nbytes, int fg, int bg);
  76. void    vidDrawText(int x, int y, char *text, int len, font_t *font);
  77.  
  78. /*
  79.  * Pixel lookup table for 8 bit displays
  80.  */
  81. extern unsigned char    VPixelLookup[];
  82.  
  83. /*
  84.  * Gamma correction lookup tables
  85.  */
  86. extern unsigned char    RGB8Lookup[3][256];
  87.  
  88. extern unsigned char    RGB32Bits[3];
  89. extern unsigned char    RGB32Shift[3];
  90. extern unsigned long    RGB32Lookup[3][256];
  91.  
  92. extern font_t        *Font8x14;
  93. extern font_t        *DefaultFont;
  94.  
  95. extern unsigned    Black;
  96. extern unsigned    White;
  97.  
  98. #endif    /* VIDEO_H */
  99.